#include<stdio.h>
#include<unistd.h>
int main()
{
  FILE *fp=fopen("log.txt","w");
  if(fp==NULL)
  {
    perror("fopen");
    return 1;
  }
  const char *msg="hello linux";
  int cnt=1;
  while(cnt<=5)
  {
    fprintf(fp,"%s:%d\n",msg,cnt++);
  }

  return 0;
}
